#include<iostream>
using namespace std;
#include<string>

//class calculator
//{
//public:
//
//	int getresult(string oper)
//	{
//		if (oper == "+")
//		{
//			return m_num1 + m_num2;
//		}
//		else if (oper == "-")
//		{
//			return m_num1 - m_num2;
//		}
//		else if (oper == "*")
//		{
//			return m_num1 * m_num2;
//		}
//	}
//
//	int m_num1;
//	int m_num2;
//};
//
//void test01()
//{
//	calculator c;
//	c.m_num1 = 10;
//	c.m_num2 = 10;
//	cout << c.m_num1 << "+" << c.m_num2 << "=" << c.getresult("+") << endl;
//}
//
//int main()
//{
//	test01();
//	system("pause");
//	return 0;
//}


class abstractcalculator
{
public:

	virtual int getresult()
	{
		return 0;
	}
	int m_num1;
	int m_num2;
};

class addcalculator :public abstractcalculator
{public:
	int getresult()
	{
		return m_num1 + m_num2;
	}

};
class subcalculator :public abstractcalculator
{
	public:
	int getresult()
	{
		return m_num1 - m_num2;
	}
};

void test03()
{
	abstractcalculator* c = new addcalculator;
	c->m_num1 = 10;
	c->m_num2 = 10;
	cout << c->m_num1 << "+" << c->m_num2 << "=" << c->getresult() << endl;
	delete c;
}

int main()
{
	test03();
	//system("pause");
	return 0;
}